package cn.itcast.mapper;

import cn.itcast.pojo.Account;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserMapper {
    @Select("select * from account")
    public List<Account> findAll();

    @Select("select * from account where name=#{name}")
    public Account findByName(@Param("name") String name);

    @Insert("insert into account(name,money) values(#{name},#{money})")
    void insert(Account account);

    @Update("update account set name = #{name},money=#{money} where id = #{id}")
    void update(Account account);

    @Delete("delete from account where id = #{id}")
    void delete(@Param("id") Integer id);
}

